package com.hulk.dryad.admin.api.vo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.hulk.dryad.common.annotation.Sensitive;
import com.hulk.dryad.common.jackson.sensitive.SensitiveTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author kim
 * @since 2020-10-29
 */

@Data
@Accessors(chain = true)
@ApiModel(value = "用户")
public class SysUserVO implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@ApiModelProperty(value = "用户编号")
	private Long userId;

	/**
	 * 用户名
	 */
	@ApiModelProperty(value = "用户名")
	private String username;

	/**
	 * 密码
	 */
	@Sensitive(type = SensitiveTypeEnum.PASSWORD)
	@ToString.Exclude
	@ApiModelProperty(value = "密码")
	private String password;

	/**
	 * 随机盐
	 */
	@ToString.Exclude
	@JsonIgnore
	@ApiModelProperty(value = "随机盐")
	private String salt;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createdTime;

	/**
	 * 修改时间
	 */
	@ApiModelProperty(value = "修改时间")
	private LocalDateTime updatedTime;

	/**
	 * 0-正常，1-删除
	 */
	@ApiModelProperty(value = "删除标记,1:已删除,0:正常")
	private String delFlag;

	/**
	 * 锁定标记
	 */
	@ApiModelProperty(value = "锁定标记")
	private String lockFlag;

	/**
	 * 手机号
	 */
	//@Sensitive(type = SensitiveTypeEnum.MOBILE_PHONE)
	@ApiModelProperty(value = "手机号")
	private String phone;

	/**
	 * 头像
	 */
	@ToString.Exclude
	@ApiModelProperty(value = "头像地址")
	private String avatar;

	/**
	 * 部门ID
	 */
	@ApiModelProperty(value = "用户所属部门id")
	private Integer deptId;

	/**
	 * TOTP
	 */
	@ApiModelProperty(value = "TOTP")
	@Sensitive(prefixNoMaskLen=4,suffixNoMaskLen=4)
	@ToString.Exclude
	private String totp;

	/**
	 * TOKEN过期时间
	 */
	@ApiModelProperty(value = "TOKEN过期时间")
	private LocalDateTime tokenExpireTime;

	/**
	 * 1:离线 0:在线
	 */
	@ApiModelProperty(value = "在线标记")
	private String onlineFlag;

	/**
	 * 超级管理员标识
	 */
	@ApiModelProperty(value = "超级管理员标识")
	private String rootFlag;

	/**
	 * 租户ID
	 */
	@ApiModelProperty(value = "用户所属租户id")
	private String tenantId;

}
